import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.SWT;
import org.eclipse.wb.swt.SWTResourceManager;
import org.eclipse.swt.widgets.Text;
import org.eclipse.swt.widgets.Combo;
import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.events.MouseAdapter;
import org.eclipse.swt.events.MouseEvent;
import org.eclipse.swt.events.PaintEvent;
import org.eclipse.swt.events.PaintListener;
import org.eclipse.swt.widgets.Canvas;


// TODO: Auto-generated Javadoc
/**
 * The Class ManageUsers.
 */
public class ManageUsers {

	/** The shell. */
	protected Shell shell;
	
	/** The text. */
	private Text text;
	
	/** The text_1. */
	private Text text_1;
	
	/** The text_2. */
	private Text text_2;

	/**
	 * Launch the application.
	 *
	 * @param args the arguments
	 */
	public static void main(String[] args) {
		try {
			ManageUsers window = new ManageUsers();
			window.open();
		} catch (Exception e) {
			e.printStackTrace();
		}
	}

	/**
	 * Open the window.
	 */
	public void open() {
		Display display = Display.getDefault();
		createContents();
		shell.open();
		shell.layout();
		while (!shell.isDisposed()) {
			if (!display.readAndDispatch()) {
				display.sleep();
			}
		}
	}

	/**
	 * Create contents of the window.
	 */
	protected void createContents() {
		shell = new Shell();
		shell.setSize(700, 500);
		shell.setText("SWT Application");
		
		//adding background
		final Display display = Display.getDefault();
		
		Canvas canvas = new Canvas(shell, SWT.NONE);
		canvas.addPaintListener(new PaintListener() {
			public void paintControl(PaintEvent arg0) {
					 org.eclipse.swt.graphics.Image image = new org.eclipse.swt.graphics.Image(display, "/Users/kennyha/Desktop/Eclipse Workplace/pokemonBackground.png");
					 arg0.gc.drawImage(image, 10, 10);

				        image.dispose();
				
			}
		});
		canvas.setBounds(-11, -14, 711, 492);
		
		Label lblManageUser = new Label(canvas, SWT.NONE);
		lblManageUser.setForeground(SWTResourceManager.getColor(SWT.COLOR_WHITE));
		lblManageUser.setBounds(281, 24, 222, 36);
		lblManageUser.setFont(SWTResourceManager.getFont("Lucida Grande", 25, SWT.BOLD));
		lblManageUser.setText("Manage Users");
		
		text = new Text(canvas, SWT.BORDER);
		text.setBounds(154, 110, 119, 19);
		
		Label lblSearchUserBy = new Label(canvas, SWT.NONE);
		lblSearchUserBy.setBounds(279, 113, 104, 14);
		lblSearchUserBy.setForeground(SWTResourceManager.getColor(SWT.COLOR_WHITE));
		lblSearchUserBy.setText("Search user by: ");
		
		Combo combo = new Combo(canvas, SWT.NONE);
		combo.setBounds(371, 109, 91, 22);
		combo.setItems(new String[] {"Last Name", "First Name", "Birthday"});
		combo.select(0);
		
		Button btnSearch = new Button(canvas, SWT.NONE);
		btnSearch.setBounds(481, 105, 71, 30);
		btnSearch.setText("Search");
		
		Label lblNewPassword = new Label(canvas, SWT.NONE);
		lblNewPassword.setBounds(399, 166, 104, 14);
		lblNewPassword.setForeground(SWTResourceManager.getColor(SWT.COLOR_WHITE));
		lblNewPassword.setText("New Password");
		
		text_1 = new Text(canvas, SWT.BORDER);
		text_1.setBounds(399, 188, 119, 19);
		
		Label lblConfirmPassword = new Label(canvas, SWT.NONE);
		lblConfirmPassword.setBounds(399, 213, 104, 14);
		lblConfirmPassword.setForeground(SWTResourceManager.getColor(SWT.COLOR_WHITE));
		lblConfirmPassword.setText("Confirm Password");
		
		text_2 = new Text(canvas, SWT.BORDER);
		text_2.setBounds(399, 233, 119, 19);
		
		Button btnSubmit = new Button(canvas, SWT.NONE);
		btnSubmit.setBounds(399, 271, 108, 30);
		btnSubmit.setText("Submit");
		
		Button btnDelete = new Button(canvas, SWT.NONE);
		btnDelete.setBounds(199, 166, 108, 30);
		btnDelete.setText("Delete");
		
		Button btnReset = new Button(canvas, SWT.NONE);
		btnReset.setBounds(199, 199, 108, 30);
		btnReset.setText("Reset Password");
		
		Button btnResetLogin = new Button(canvas, SWT.NONE);
		btnResetLogin.setBounds(199, 235, 111, 30);
		btnResetLogin.setText("Reset Login");
		
		Button btnSus = new Button(canvas, SWT.NONE);
		btnSus.setBounds(199, 271, 111, 30);
		btnSus.setText("Suspend");
		
		Button btnUnsuspend = new Button(canvas, SWT.NONE);
		btnUnsuspend.setBounds(199, 307, 111, 30);
		btnUnsuspend.setText("Unsuspend");
		
		Button btnBack = new Button(canvas, SWT.NONE);
		btnBack.setBounds(305, 425, 108, 30);
		btnBack.addMouseListener(new MouseAdapter() {
			@Override
			public void mouseUp(MouseEvent e) {
				Object window;
				shell.close();
				window = new NurseDoctor();
				((NurseDoctor)window).open();
				
			}
		});
		btnBack.setText("Back");
		

	}
}
